

import java.util.Arrays;
import java.util.Scanner;

public class test {

    public static void main(String[] args) {
        System.out.println("请输入几个数并用逗号隔开：");
        Scanner sc = new Scanner(System.in);
        String str = sc.next().toString();
        String[] arr  = str.split(",");
        int[] b = new int[arr.length];
        for(int j = 0; j<b.length;j++) {
            b[j] = Integer.parseInt(arr[j]);
            System.out.println(b[j]+" ");
        }

        Boolean sss=new Solution().containsDuplicate(b);
        System.out.println(sss);
    }



}


class Solution {
    public boolean containsDuplicate(int[] nums) {
        //排序后，是否存在项相邻元素相同的情况
        Arrays.sort(nums);
        int n = nums.length;
        for (int i = 0; i < n - 1; i++) {
            if (nums[i] == nums[i + 1]) {
                return true;
            }
        }
        return false;
    }
}


